package model

import (
	"gorm.io/gorm"
	"time"
)

type Good struct {
	Id          uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	Picture     string         `gorm:"column:picture;type:varchar(255);default:NULL;" json:"picture"`
	Name        string         `gorm:"column:name;type:varchar(64);default:NULL;" json:"name"`
	GoodNum     string         `gorm:"column:good_num;type:varchar(255);default:NULL;" json:"good_num"`
	GoodClassId uint           `gorm:"column:good_class_id;type:int(10);default:NULL;" json:"good_class_id"`
	Incule      string         `gorm:"column:incule;type:varchar(255);default:NULL;" json:"incule"`
	Number      int32          `gorm:"column:number;type:int(10);default:NULL;" json:"number"`
	Price       float64        `gorm:"column:price;type:decimal(10, 2);default:NULL;" json:"price"`
	CreatedAt   time.Time      `gorm:"column:created_at;type:datetime(3);default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt   time.Time      `gorm:"column:updated_at;type:datetime(3);default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt   gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (g *Good) TableName() string {
	return "good"
}
